﻿
using Base.ClientUI;
using Base.WCS.Entity;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Collections.Generic;
 namespace Base.ClientUI {
    public class HttpParam {
        static public bool UpdateCraneOverStop(int CraneId,int value)
        {
            JValue data = WCSHttpUtil.getJValue(WCSHttpUtil.baseUrl + "param/updateCraneOverStop/" + CraneId + "/" + value);
            if (data == null)
            {
                return false;
            }
            return bool.Parse(data.ToString());
        }


      
        static public int GetCraneOverStop(int CraneId) {
            JValue data = WCSHttpUtil.getJValue(WCSHttpUtil.baseUrl + "param/GetCraneOverStop/" + CraneId);
            if (data == null) {
                return 3;
            }
            return int.Parse(data.Value.ToString());
        }

        

        static public bool updateValue(int id,  long value) { 
            JValue data = WCSHttpUtil.getJValue(WCSHttpUtil.baseUrl + "param/updateValue/" + id + "/" + value);
            if (data == null) {
                return false;
            }
            return bool.Parse(data.ToString());
        }
        static public List<SysParam> getParam( ) {//updateParam/{driveType}/{driveId}/{key}/{value}
            List<SysParam> data = WCSHttpUtil.getList<SysParam>(WCSHttpUtil.baseUrl + "param/getParams");
            if( data == null ) {
                return null;
            }
            return data;
        }
        
        
       
        
       }
}
